<?php if (!defined('THINK_PATH')) exit();?><html>
    <head>
        <title>登录</title>
        <link href="<?php echo (ADMIN_CSS_URL); ?>bootstrap.css" rel="stylesheet" />
        <link href="<?php echo (ADMIN_CSS_URL); ?>lz-style.css" rel="stylesheet" />
        <script src="<?php echo (ADMIN_JS_URL); ?>jquery.js"></script>
        <script src="<?php echo (ADMIN_JS_URL); ?>jquery.form.js"></script>
        <script src="<?php echo (ADMIN_JS_URL); ?>bootstrap.js"></script>
        <script language="JavaScript">
            $(function () {
                $('#loginForm').ajaxForm({
                    beforeSubmit: checkForm, // pre-submit callback
                    success: complete, // post-submit callback
                    dataType: 'json'
                });
                function checkForm() {
                    if ('' == $.trim($('#OperatorID').val())) {
                        $('#success').hide();
                        $('#error').html('[用户ID]不能为空').show();
                        return false;
                    }
                    if ('' == $.trim($('#LoginPasswd').val())) {
                        $('#success').hide();
                        $('#error').html('[登陆密码]不能为空').show();
                        return false;
                    }
                    if ('' == $.trim($('#captcha').val())) {
                        $('#success').hide();
                        $('#error').html('[验证码]不能为空').show();
                        return false;
                    }
                    //可以在此添加其它判断
                }
                function complete(data) {
                    if (data.status === 1) {
                        $('#error').hide();
                        $('#success').html(data.info).show();
                        window.location.href="/ecs/index.php/Admin/Index/index"
                    } else {
                        $('#success').hide();
                        $('#error').html(data.info).show();
                    }
                }
            });
        </script>
        <script language="JavaScript">
            function refreshVerifyImg() {
                $('#verifyImg').attr("src", "/ecs/index.php/Admin/Operator/verifyImg");
            }
        </script>
    </head>
    <body>
        <div class="container div_login">
            <div class="row div_login_top text-center">
                <h1>后台管理系统v1.0</h1>
            </div>
            <div class="row div_login_middle ">
                <div class=" col-xs-6 col-sm-3 "></div>
                <div class=" col-xs-6 col-sm-6 div_login_panel">
                    <div class="row div_login_panel_head">

                    </div>
                    <form id="loginForm" action="#" method="post">
                        <div class="row div_login_panel_middle">
                            <div class="row div_login_panel_ctl">
                                <div class="text-right col-xs-6 col-sm-3 " ><label for="OperatorName" class="control-label">用  户  ID</label></div>
                                <div class="col-xs-6 col-sm-6" >
                                    <input type="text" id="OperatorID" name="OperatorID" class="form-control" placeholder="用户ID"  value="" maxlength="12" required/>
                                </div>
                            </div>
                            <div class="row div_login_panel_ctl">
                                <div class="text-right col-xs-6 col-sm-3 " ><label for="LoginPasswd" class="control-label">登录密码</label></div>
                                <div class="col-xs-6 col-sm-6" >
                                    <input type="password" id="LoginPasswd" name="LoginPasswd" class="form-control" placeholder="登录密码"  value="" maxlength="12"  required/>
                                </div>
                            </div>
                            <div class="row div_login_panel_ctl">
                                <div class="text-right col-xs-6 col-sm-3 " ><label for="captcha" class="control-label">验  证  码</label></div>
                                <div class="col-xs-6 col-sm-6" >
                                    <input class="form-control" id="captcha" name="captcha" type="text" placeholder="验证码" maxlength="4">
                                </div>
                                <div class="col-xs-6 col-sm-3">
                                    <img id="verifyImg" name="verifyImg" src="/ecs/index.php/Admin/Operator/verifyImg"  alt="" onclick="refreshVerifyImg()"/>
                                </div>
                            </div>
                            <div class="row ">
                                <div class="col-xs-6 col-sm-5">
                                </div>
                                <div class="col-xs-6 col-sm-2">
                                    <input type="submit" id="login" name="login"  class="btn btn-default" value="登录">
                                </div>
                            </div>

                        </div>
                        <div class="row div_login_panel_footer">
                            <div class="col-xs-6 col-sm-5">
                            </div>
                            <div class="col-xs-6 col-sm-2">
                                <div id="error" class="row text-danger"></div>
                                <div id="success" class="row text-success"></div>
                            </div>

                        </div>
                    </form>

                </div>

            </div>


            <div class="row div_login_footer text-center">
                Copyright © 2017.公司名 All rights reserved.
            </div>
        </div>    
    </body>
</html>